home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 385 / prg_1 / prg_1cp.s < prev    next >
Text File  |  1985-11-19  |  3KB  |  58 lines

  1.  ; Program Name: PRG_1CP.S
  2.  ;      Version: 1.002
  3.  
  4.  ; Assembly Instructions:
  5.  
  6.  ;     Assemble in AssemPro PC-relative mode and save the assembled program
  7.  ; with PRG and TOS extensions.
  8.  
  9.  ; Program Function:
  10.  
  11.  ;     Prints a string to the video screen.  If the program is executed
  12.  ; within the AssemPro debugger, the string should overwrite the debugger
  13.  ; screen, even if the AssemPro "Save Screen" option has been selected.  To
  14.  ; verify this phenomenon, power the computer down, then back up.  Execute
  15.  ; ASSEMPRO.PRG, then load or type this program into the editor.  Assemble,
  16.  ; then activate the debugger.  Select "Save Screen" and "symbolic".  Finally,
  17.  ; select "Run Program".  The debugger screen will be overwritten in an
  18.  ; unpredictable area.
  19.  
  20.  ;     Watch the debugger screen carefully, during execution, so that you
  21.  ; will be able to see the writeover occur. 
  22.  
  23.  ;     Depending on the location of the overwritten area, AssemPro may
  24.  ; redraw a portion of its screen after the event.
  25.  
  26.  ;     The overwrite is likely to occur only once, the first time a program
  27.  ; which writes to the screen is executed within the debugger.
  28.  
  29.  ;     After the string has been written, the program waits until a key
  30.  ; is pressed on the keyboard.  When that event occurs, it returns control
  31.  ; to the debugger.
  32.  
  33.  ; Note - We have not defined a program stack.  We are using the default
  34.  ;        system stack located at $4DB8, according to Internals page 276.
  35.  
  36. print_string:
  37.  pea        string              ; Push address of the string onto stack.
  38.  move.w     #9, -(sp)           ; Function = c_conws = GEMDOS $9.
  39.  trap       #1                  ; GEMDOS call
  40.  addq.l     #6, sp              ; Reset stack pointer to top of stack.
  41.  
  42. wait_for_keypress: 
  43.  move.w     #8, -(sp)           ; Function = c_necin = GEMDOS $8.
  44.  trap       #1                  ; GEMDOS call.
  45.  addq.l     #2, sp              ; Reposition stack pointer at top of stack.
  46.  
  47. terminate:                      ; My descriptive label.
  48.  move.w    #0, -(sp)            ; Function = p_term_old = GEMDOS $0.
  49.  trap      #1                   ; GEMDOS call.
  50.  
  51. string:     dc.b 'This string will overwrite the AssemPro debugger screen.'
  52.             dc.b $D,$A,0  ; The string is continued on this line.  Here, we
  53.                           ; declare a carriage return and linefeed, then
  54.                           ; terminate the entire string with a NULL = 0.
  55.  
  56.  end                      ; Assembler pseudo-op.
  57.  
  58.